<%@ page language="java" pageEncoding="UTF-8" %>
<!doctype html>
<html lang="zh-CN">
<head>
    <%@include file="/WEB-INF/views/commons/common.jsp" %>
    <link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/bootstrap-dialog3/css/bootstrap-dialog.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/validation-engine/validationEngine.jquery.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/jquery-easyui/1.4.3/themes/metro/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/font-awesome/4.3.0/css/font-awesome.min.css">

    <link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/viewer/viewer.css">

    <link rel="stylesheet" type="text/css" href="${base_href}/static/css/search-theme.css">
    <link rel="stylesheet" type="text/css" href="${base_href}/static/css/form-theme.css">

    <title>银成教育</title>
</head>
<body data-spy="scroll" data-target="#myScrollspy" data-offset="350">

<div class="main-wrap">

    <!-- 工具条 start-->
    <div class="container-fluid form-body-header">
        <div class="container">
            <div class="row tool-bar">
                <div class="col-xs-12">
                    <button type="button" class="btn btn-sm tool-btn" id="saveBtn">保存</button>
                </div>
            </div>
        </div>
    </div>
    <!-- 工具条 end-->

    <!-- 表单 start-->
    <div class="container-fluid">
        <form id="form">
            <input type="hidden" name="userId" value="${form.userId }"/>
            <div class="container form-body-div">
                <div class="row text-center title-body" id="baseinfo">
                    学员信息表<br/>
                </div>

                <div class="row pannel-title">
                    <span>基本信息</span> <a href="javascript:void(0);" class="hide-next-btn">收起</a>
                </div>
                <div class="row pannel-body">
                    <table class="form-table">
                        <tr>
                            <th class="col-xs-2 ">学员姓名</th>
                            <td class="col-xs-4">
                                <input type="text" class="form-control validate[required]" name="userName"
                                       value="${form.userName}"/>
                            </td>
                            <th class="col-xs-2 ">学员账号</th>
                            <td class="col-xs-4">
                                ${form.userAccount}
                            </td>
                        </tr>
                        <tr>
                            <th class="col-xs-2 ">学员电话</th>
                            <td class="col-xs-4">
                                ${form.telephone}
                            </td>
                            <td class="text-right col-xs-2">助教姓名</td>
                            <td class="col-xs-4">
                                <input type="hidden" name="assistantName" value="${form.assistantName }"/>
                                <select id="assistantId" name="assistantId" class="form-control">
                                    <option value="" selected="selected">请选择</option>
                                    <c:forEach items="${assistantList}" var="state">
                                        <option value="${state.userId}"
                                                <c:if test="${form.assistantId eq state.userId }">selected="selected"</c:if>>
                                                ${state.userName}
                                        </option>
                                    </c:forEach>
                                </select>
                            </td>
                        </tr>

                    </table>
                </div>

            </div>
        </form>
    </div>
    <!-- 表单 end-->

</div>
<script type="text/javascript" src="${base_href}/static/ui-frame/jquery/1.11.3/jquery.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap/3.3.5/js/bootstrap.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap-dialog3/js/bootstrap-dialog.js"></script>
<script type="text/javascript"
        src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript" src="${base_href}/static/support/student/student-edit.js"></script>

<script type="text/javascript">
    $(function () {
        $('#form').validationEngine('attach', {
            maxErrorsPerField: 1,
            scroll: false,
            validationEventTrigger: "keyup blur change focus",
            ValidateNoneVisibleFields: true,//验证隐藏域
            promptPosition: "topRight" //验证弹出框的位置，topRight,topLeft,bottomRight,bottomLeft,centerRight,centerLeft,inline
        });
        $('#assistantId').change(function () {
            var assistantName = $(this).children('option:selected').text();//这就是selected的值
            $("input[name='assistantName']").val(assistantName);
        });
    });
</script>
</body>
</html>
